#include "QueueTp.h"


template<typename T>
bool QueueTp<T>::isempty()const
{
	return items == 0;
}
template<typename T>
bool QueueTp<T>::isfull()const
{
	return items == qsize;
}
template<typename T>
int QueueTp<T>::queuecount()const
{
	return items;
}
template<typename T>
bool QueueTp<T>::enqueue(const T& item)
{
	if (isfull())return false;
	Node* add=new Node;
	add->data = item;
	add->next = NULL;
	items++;
	if (front == NULL)
	{
		front = add;
	}
	else
	{
		rear->next = add;
	}
	rear = add;
	return true;
	
}
template<typename T>
bool QueueTp<T>::dequeue(T& item)
{
	if (isempty())return false;
	item = front->data;
	items--;
	Node* temp = front;
	front = front->next;
	delete temp;
	if (items == 0)
		rear = NULL;
	return  0;
}





